<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>操作-后台管理员</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link href="${basePath}/admin/css/base.css" type="text/css" rel="stylesheet">
    <script language="javascript" src="${basePath}/admin/js/jquery.js"></script>
   	<style type="text/css">
		ul li{list-style:none;height:50px;}
	</style>
</head>
<body>
<p></p>
<div id="container" style="background:#f2ffe3 url(${basePath}/admin/images/main_00.jpg) left top repeat-x;">
<h2><#if admin.id??>更新<#else>添加</#if>管理员</h2>&nbsp;&nbsp;

     <form action="${basePath}/admin/admin/<#if admin.id??>update<#else>save</#if>" method="POST">
      	<input type="hidden" name="actor_id" value="${actor_id!}"/>
      	<input type="hidden" name="admin.id" value="${admin.id!}"/>
      	<input type="hidden" name="admin.create_time" value="<#if admin.create_time??>${admin.create_time?string('yyyy-MM-dd HH:mm:ss')}<#else></#if>"/>
      	<!-- 
      	<input type="hidden" name="admin.login_time" value="${admin.login_time!}"/>
      	 -->
      	<input type="hidden" name="admin.login_ip" value="${admin.login_ip!}"/>
      	<input type="hidden" name="admin.login_num" value="${admin.login_num!}"/>
      	<input type="hidden" name="old_password" value="${admin.password!}"/>
      	<ul>
        	<li>名称：	
        				<select name="admin.actor_id" class="select_203">
        					<#list actors as a>
        						<#if admin.actor_id?? && admin.actor_id == a.id>
        							<option value="${a.id!}" selected="selected">${a.name!}</option>
        						<#else>
        							<option value="${a.id!}">${a.name!}</option>
        						</#if>
        					</#list>
        				</select>	
						${actor_idError!}</li>
        	<li>昵称：		<input type="text" class="input_200" name="admin.nickname" value="${admin.nickname!}" />	${nicknameError!}</li>
        	<li>登陆名：	<input type="text" id="username" class="input_200" name="admin.username" value="${admin.username!}" onchange="checkUserName()"/> <label id="checkRemind" attr="true"></label>	${usernameError!}</li>
        	<li>密码：		<input type="password" class="input_200" name="admin.password" value="${admin.password!}" />	${passwordError!}</li>
        	<li>座机：		<input type="text" class="input_200" name="admin.phone" value="${admin.phone!}" />	${phoneError!}</li>
        	<li>手机：		<input type="text" class="input_200" name="admin.telephone" value="${admin.telephone!}" />	${telephoneError!}</li>
        	<li>邮箱：		<input type="text" class="input_200" name="admin.email" value="${admin.email!}" />	${emailError!}</li>
        	<li>登陆次数：	<input type="text" class="input_200" name="admin.login_num" value="${admin.login_num!0}"  readonly="readonly"/>	${login_numError!}</li>
        	<li>
        		是否禁用:	
        				<#if admin.disable?? && admin.disable == 1>
	        				<input type="radio" name="admin.disable" value="1" checked="checked"/> 是
	        				<input type="radio" name="admin.disable" value="-1" /> 否
        				<#else>	
	        				<input type="radio" name="admin.disable" value="1"/> 是
	        				<input type="radio" name="admin.disable" value="-1" checked="checked"/> 否
        				</#if>
        				${disableError!}
        	</li>
        	<li>
        				<input type="reset" class="button_60" value="重置"	/>
        				<input type="submit" class="button_60" value="提交"	/>
        	</li>
             
           </ul>
      </form>
  </div>
  <script type="text/javascript">
  	function checkUserName(){
  		var username = $("#username").val();
  		$.ajax({
  			url:"${basePath}/admin/ajax/checkUserName",	
  			type:"post",
  			data:{username:username},
  			datatype:"json",
  			async:false,
  			success:function(data){
  				var $checkRemind = $("#checkRemind");
  				if(data.result){		// 存在
  					$checkRemind.html("登陆名已存在,请更换");
  					$checkRemind.css("color","red");
  					$checkRemind.attr("attr","false");
  				}else{		// 不存在
  					$checkRemind.html("登陆名可以使用");
  					$checkRemind.css("color","green");
  				}
  				
  			}});  
  	}
  	
  	function checkSubmit(){
  		if($("#checkRemind").attr("attr") === "false") return false;
  		return true;
  	}
  </script>
</body>
</html>